3.197 \(\int \frac{\sec (e+f x) (a+a \sec (e+f x))^2}{c+d \sec (e+f x)} \, dx\)

Optimal. Leaf size=95 \[ -\frac{a^2 (c-2 d) \tanh ^{-1}(\sin (e+f x))}{d^2 f}+\frac{2 a^2 (c-d)^{3/2} \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{d^2 f \sqrt{c+d}}+\frac{a^2 \tan (e+f x)}{d f} \]

[Out]

-((a^2*(c - 2*d)*ArcTanh[Sin[e + f*x]])/(d^2*f)) + (2*a^2*(c - d)^(3/2)*ArcTanh[(Sqrt[c - d]*Tan[(e + f*x)/2])
/Sqrt[c + d]])/(d^2*Sqrt[c + d]*f) + (a^2*Tan[e + f*x])/(d*f)

________________________________________________________________________________________

Rubi [B]  time = 0.245479, antiderivative size = 208, normalized size of antiderivative = 2.19, number of steps used = 8, number of rules used = 8, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.258, Rules used = {3987, 102, 157, 63, 217, 203, 93, 205} \[ -\frac{2 a^3 (c-2 d) \tan (e+f x) \tan ^{-1}\left (\frac{\sqrt{a-a \sec (e+f x)}}{\sqrt{a (\sec (e+f x)+1)}}\right )}{d^2 f \sqrt{a-a \sec (e+f x)} \sqrt{a \sec (e+f x)+a}}-\frac{2 a^3 (c-d)^{3/2} \tan (e+f x) \tan ^{-1}\left (\frac{\sqrt{c+d} \sqrt{a \sec (e+f x)+a}}{\sqrt{c-d} \sqrt{a-a \sec (e+f x)}}\right )}{d^2 f \sqrt{c+d} \sqrt{a-a \sec (e+f x)} \sqrt{a \sec (e+f x)+a}}+\frac{a^2 \tan (e+f x)}{d f} \]

Antiderivative was successfully verified.

[In]

Int[(Sec[e + f*x]*(a + a*Sec[e + f*x])^2)/(c + d*Sec[e + f*x]),x]

[Out]

(a^2*Tan[e + f*x])/(d*f) - (2*a^3*(c - 2*d)*ArcTan[Sqrt[a - a*Sec[e + f*x]]/Sqrt[a*(1 + Sec[e + f*x])]]*Tan[e
+ f*x])/(d^2*f*Sqrt[a - a*Sec[e + f*x]]*Sqrt[a + a*Sec[e + f*x]]) - (2*a^3*(c - d)^(3/2)*ArcTan[(Sqrt[c + d]*S
qrt[a + a*Sec[e + f*x]])/(Sqrt[c - d]*Sqrt[a - a*Sec[e + f*x]])]*Tan[e + f*x])/(d^2*Sqrt[c + d]*f*Sqrt[a - a*S
ec[e + f*x]]*Sqrt[a + a*Sec[e + f*x]])

Rule 3987

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]
*(d_.) + (c_))^(n_), x_Symbol] :> Dist[(a^2*g*Cot[e + f*x])/(f*Sqrt[a + b*Csc[e + f*x]]*Sqrt[a - b*Csc[e + f*x
]]), Subst[Int[((g*x)^(p - 1)*(a + b*x)^(m - 1/2)*(c + d*x)^n)/Sqrt[a - b*x], x], x, Csc[e + f*x]], x] /; Free
Q[{a, b, c, d, e, f, g, m, n, p}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && (EqQ[p,
 1] || IntegerQ[m - 1/2])

Rule 102

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(b*(a +
 b*x)^(m - 1)*(c + d*x)^(n + 1)*(e + f*x)^(p + 1))/(d*f*(m + n + p + 1)), x] + Dist[1/(d*f*(m + n + p + 1)), I
nt[(a + b*x)^(m - 2)*(c + d*x)^n*(e + f*x)^p*Simp[a^2*d*f*(m + n + p + 1) - b*(b*c*e*(m - 1) + a*(d*e*(n + 1)
+ c*f*(p + 1))) + b*(a*d*f*(2*m + n + p) - b*(d*e*(m + n) + c*f*(m + p)))*x, x], x], x] /; FreeQ[{a, b, c, d,
e, f, n, p}, x] && GtQ[m, 1] && NeQ[m + n + p + 1, 0] && IntegersQ[2*m, 2*n, 2*p]

Rule 157

Int[(((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_)*((g_.) + (h_.)*(x_)))/((a_.) + (b_.)*(x_)), x_Symbol]
 :> Dist[h/b, Int[(c + d*x)^n*(e + f*x)^p, x], x] + Dist[(b*g - a*h)/b, Int[((c + d*x)^n*(e + f*x)^p)/(a + b*x
), x], x] /; FreeQ[{a, b, c, d, e, f, g, h, n, p}, x]

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 217

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 93

Int[(((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_))/((e_.) + (f_.)*(x_)), x_Symbol] :> With[{q = Denomin
ator[m]}, Dist[q, Subst[Int[x^(q*(m + 1) - 1)/(b*e - a*f - (d*e - c*f)*x^q), x], x, (a + b*x)^(1/q)/(c + d*x)^
(1/q)], x]] /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[m + n + 1, 0] && RationalQ[n] && LtQ[-1, m, 0] && SimplerQ[
a + b*x, c + d*x]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\sec (e+f x) (a+a \sec (e+f x))^2}{c+d \sec (e+f x)} \, dx &=-\frac{\left (a^2 \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{(a+a x)^{3/2}}{\sqrt{a-a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{a^2 \tan (e+f x)}{d f}+\frac{(a \tan (e+f x)) \operatorname{Subst}\left (\int \frac{-a^3 d+a^3 (c-2 d) x}{\sqrt{a-a x} \sqrt{a+a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{d f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{a^2 \tan (e+f x)}{d f}+\frac{\left (a^4 (c-2 d) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt{a-a x} \sqrt{a+a x}} \, dx,x,\sec (e+f x)\right )}{d^2 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}-\frac{\left (a^4 (c-d)^2 \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt{a-a x} \sqrt{a+a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{d^2 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{a^2 \tan (e+f x)}{d f}-\frac{\left (2 a^3 (c-2 d) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt{2 a-x^2}} \, dx,x,\sqrt{a-a \sec (e+f x)}\right )}{d^2 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}-\frac{\left (2 a^4 (c-d)^2 \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{a c-a d-(-a c-a d) x^2} \, dx,x,\frac{\sqrt{a+a \sec (e+f x)}}{\sqrt{a-a \sec (e+f x)}}\right )}{d^2 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{a^2 \tan (e+f x)}{d f}-\frac{2 a^3 (c-d)^{3/2} \tan ^{-1}\left (\frac{\sqrt{c+d} \sqrt{a+a \sec (e+f x)}}{\sqrt{c-d} \sqrt{a-a \sec (e+f x)}}\right ) \tan (e+f x)}{d^2 \sqrt{c+d} f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}-\frac{\left (2 a^3 (c-2 d) \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\frac{\sqrt{a-a \sec (e+f x)}}{\sqrt{a+a \sec (e+f x)}}\right )}{d^2 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{a^2 \tan (e+f x)}{d f}-\frac{2 a^3 (c-2 d) \tan ^{-1}\left (\frac{\sqrt{a-a \sec (e+f x)}}{\sqrt{a+a \sec (e+f x)}}\right ) \tan (e+f x)}{d^2 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}-\frac{2 a^3 (c-d)^{3/2} \tan ^{-1}\left (\frac{\sqrt{c+d} \sqrt{a+a \sec (e+f x)}}{\sqrt{c-d} \sqrt{a-a \sec (e+f x)}}\right ) \tan (e+f x)}{d^2 \sqrt{c+d} f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ \end{align*}

Mathematica [C]  time = 1.98948, size = 329, normalized size = 3.46 \[ \frac{a^2 \cos (e+f x) \sec ^4\left (\frac{1}{2} (e+f x)\right ) (\sec (e+f x)+1)^2 (c \cos (e+f x)+d) \left (-\frac{2 i (c-d)^2 (\cos (e)-i \sin (e)) \tan ^{-1}\left (\frac{(\sin (e)+i \cos (e)) \left (\tan \left (\frac{f x}{2}\right ) (c \cos (e)-d)+c \sin (e)\right )}{\sqrt{c^2-d^2} \sqrt{(\cos (e)-i \sin (e))^2}}\right )}{\sqrt{c^2-d^2} \sqrt{(\cos (e)-i \sin (e))^2}}+(c-2 d) \log \left (\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )\right )-(c-2 d) \log \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )+\frac{d \sin \left (\frac{f x}{2}\right )}{\left (\cos \left (\frac{e}{2}\right )-\sin \left (\frac{e}{2}\right )\right ) \left (\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )\right )}+\frac{d \sin \left (\frac{f x}{2}\right )}{\left (\sin \left (\frac{e}{2}\right )+\cos \left (\frac{e}{2}\right )\right ) \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )}\right )}{4 d^2 f (c+d \sec (e+f x))} \]

Antiderivative was successfully verified.

[In]

Integrate[(Sec[e + f*x]*(a + a*Sec[e + f*x])^2)/(c + d*Sec[e + f*x]),x]

[Out]

(a^2*Cos[e + f*x]*(d + c*Cos[e + f*x])*Sec[(e + f*x)/2]^4*(1 + Sec[e + f*x])^2*((c - 2*d)*Log[Cos[(e + f*x)/2]
 - Sin[(e + f*x)/2]] - (c - 2*d)*Log[Cos[(e + f*x)/2] + Sin[(e + f*x)/2]] - ((2*I)*(c - d)^2*ArcTan[((I*Cos[e]
 + Sin[e])*(c*Sin[e] + (-d + c*Cos[e])*Tan[(f*x)/2]))/(Sqrt[c^2 - d^2]*Sqrt[(Cos[e] - I*Sin[e])^2])]*(Cos[e] -
 I*Sin[e]))/(Sqrt[c^2 - d^2]*Sqrt[(Cos[e] - I*Sin[e])^2]) + (d*Sin[(f*x)/2])/((Cos[e/2] - Sin[e/2])*(Cos[(e +
f*x)/2] - Sin[(e + f*x)/2])) + (d*Sin[(f*x)/2])/((Cos[e/2] + Sin[e/2])*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])))
)/(4*d^2*f*(c + d*Sec[e + f*x]))

________________________________________________________________________________________

Maple [B]  time = 0.081, size = 291, normalized size = 3.1 \begin{align*} -{\frac{{a}^{2}}{fd} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +1 \right ) ^{-1}}-{\frac{{a}^{2}c}{f{d}^{2}}\ln \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +1 \right ) }+2\,{\frac{{a}^{2}\ln \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }{fd}}-{\frac{{a}^{2}}{fd} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) -1 \right ) ^{-1}}+{\frac{{a}^{2}c}{f{d}^{2}}\ln \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) -1 \right ) }-2\,{\frac{{a}^{2}\ln \left ( \tan \left ( 1/2\,fx+e/2 \right ) -1 \right ) }{fd}}+2\,{\frac{{a}^{2}{c}^{2}}{f{d}^{2}\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}{\it Artanh} \left ({\frac{\tan \left ( 1/2\,fx+e/2 \right ) \left ( c-d \right ) }{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}} \right ) }-4\,{\frac{{a}^{2}c}{fd\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}{\it Artanh} \left ({\frac{\tan \left ( 1/2\,fx+e/2 \right ) \left ( c-d \right ) }{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}} \right ) }+2\,{\frac{{a}^{2}}{f\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}{\it Artanh} \left ({\frac{\tan \left ( 1/2\,fx+e/2 \right ) \left ( c-d \right ) }{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c+d*sec(f*x+e)),x)

[Out]

-1/f*a^2/d/(tan(1/2*f*x+1/2*e)+1)-1/f*a^2/d^2*ln(tan(1/2*f*x+1/2*e)+1)*c+2/f*a^2/d*ln(tan(1/2*f*x+1/2*e)+1)-1/
f*a^2/d/(tan(1/2*f*x+1/2*e)-1)+1/f*a^2/d^2*ln(tan(1/2*f*x+1/2*e)-1)*c-2/f*a^2/d*ln(tan(1/2*f*x+1/2*e)-1)+2/f*a
^2/d^2/((c+d)*(c-d))^(1/2)*arctanh(tan(1/2*f*x+1/2*e)*(c-d)/((c+d)*(c-d))^(1/2))*c^2-4/f*a^2/d/((c+d)*(c-d))^(
1/2)*arctanh(tan(1/2*f*x+1/2*e)*(c-d)/((c+d)*(c-d))^(1/2))*c+2/f*a^2/((c+d)*(c-d))^(1/2)*arctanh(tan(1/2*f*x+1
/2*e)*(c-d)/((c+d)*(c-d))^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c+d*sec(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 0.9532, size = 953, normalized size = 10.03 \begin{align*} \left [\frac{2 \, a^{2} d \sin \left (f x + e\right ) -{\left (a^{2} c - a^{2} d\right )} \sqrt{\frac{c - d}{c + d}} \cos \left (f x + e\right ) \log \left (\frac{2 \, c d \cos \left (f x + e\right ) -{\left (c^{2} - 2 \, d^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \,{\left (c^{2} + c d +{\left (c d + d^{2}\right )} \cos \left (f x + e\right )\right )} \sqrt{\frac{c - d}{c + d}} \sin \left (f x + e\right ) + 2 \, c^{2} - d^{2}}{c^{2} \cos \left (f x + e\right )^{2} + 2 \, c d \cos \left (f x + e\right ) + d^{2}}\right ) -{\left (a^{2} c - 2 \, a^{2} d\right )} \cos \left (f x + e\right ) \log \left (\sin \left (f x + e\right ) + 1\right ) +{\left (a^{2} c - 2 \, a^{2} d\right )} \cos \left (f x + e\right ) \log \left (-\sin \left (f x + e\right ) + 1\right )}{2 \, d^{2} f \cos \left (f x + e\right )}, \frac{2 \, a^{2} d \sin \left (f x + e\right ) + 2 \,{\left (a^{2} c - a^{2} d\right )} \sqrt{-\frac{c - d}{c + d}} \arctan \left (-\frac{{\left (d \cos \left (f x + e\right ) + c\right )} \sqrt{-\frac{c - d}{c + d}}}{{\left (c - d\right )} \sin \left (f x + e\right )}\right ) \cos \left (f x + e\right ) -{\left (a^{2} c - 2 \, a^{2} d\right )} \cos \left (f x + e\right ) \log \left (\sin \left (f x + e\right ) + 1\right ) +{\left (a^{2} c - 2 \, a^{2} d\right )} \cos \left (f x + e\right ) \log \left (-\sin \left (f x + e\right ) + 1\right )}{2 \, d^{2} f \cos \left (f x + e\right )}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c+d*sec(f*x+e)),x, algorithm="fricas")

[Out]

[1/2*(2*a^2*d*sin(f*x + e) - (a^2*c - a^2*d)*sqrt((c - d)/(c + d))*cos(f*x + e)*log((2*c*d*cos(f*x + e) - (c^2
 - 2*d^2)*cos(f*x + e)^2 - 2*(c^2 + c*d + (c*d + d^2)*cos(f*x + e))*sqrt((c - d)/(c + d))*sin(f*x + e) + 2*c^2
 - d^2)/(c^2*cos(f*x + e)^2 + 2*c*d*cos(f*x + e) + d^2)) - (a^2*c - 2*a^2*d)*cos(f*x + e)*log(sin(f*x + e) + 1
) + (a^2*c - 2*a^2*d)*cos(f*x + e)*log(-sin(f*x + e) + 1))/(d^2*f*cos(f*x + e)), 1/2*(2*a^2*d*sin(f*x + e) + 2
*(a^2*c - a^2*d)*sqrt(-(c - d)/(c + d))*arctan(-(d*cos(f*x + e) + c)*sqrt(-(c - d)/(c + d))/((c - d)*sin(f*x +
 e)))*cos(f*x + e) - (a^2*c - 2*a^2*d)*cos(f*x + e)*log(sin(f*x + e) + 1) + (a^2*c - 2*a^2*d)*cos(f*x + e)*log
(-sin(f*x + e) + 1))/(d^2*f*cos(f*x + e))]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} a^{2} \left (\int \frac{\sec{\left (e + f x \right )}}{c + d \sec{\left (e + f x \right )}}\, dx + \int \frac{2 \sec ^{2}{\left (e + f x \right )}}{c + d \sec{\left (e + f x \right )}}\, dx + \int \frac{\sec ^{3}{\left (e + f x \right )}}{c + d \sec{\left (e + f x \right )}}\, dx\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))**2/(c+d*sec(f*x+e)),x)

[Out]

a**2*(Integral(sec(e + f*x)/(c + d*sec(e + f*x)), x) + Integral(2*sec(e + f*x)**2/(c + d*sec(e + f*x)), x) + I
ntegral(sec(e + f*x)**3/(c + d*sec(e + f*x)), x))

________________________________________________________________________________________

Giac [B]  time = 1.28523, size = 274, normalized size = 2.88 \begin{align*} -\frac{\frac{2 \, a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 1\right )} d} + \frac{{\left (a^{2} c - 2 \, a^{2} d\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1 \right |}\right )}{d^{2}} - \frac{{\left (a^{2} c - 2 \, a^{2} d\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 1 \right |}\right )}{d^{2}} + \frac{2 \,{\left (a^{2} c^{2} - 2 \, a^{2} c d + a^{2} d^{2}\right )}{\left (\pi \left \lfloor \frac{f x + e}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (2 \, c - 2 \, d\right ) + \arctan \left (\frac{c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{\sqrt{-c^{2} + d^{2}}}\right )\right )}}{\sqrt{-c^{2} + d^{2}} d^{2}}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c+d*sec(f*x+e)),x, algorithm="giac")

[Out]

-(2*a^2*tan(1/2*f*x + 1/2*e)/((tan(1/2*f*x + 1/2*e)^2 - 1)*d) + (a^2*c - 2*a^2*d)*log(abs(tan(1/2*f*x + 1/2*e)
 + 1))/d^2 - (a^2*c - 2*a^2*d)*log(abs(tan(1/2*f*x + 1/2*e) - 1))/d^2 + 2*(a^2*c^2 - 2*a^2*c*d + a^2*d^2)*(pi*
floor(1/2*(f*x + e)/pi + 1/2)*sgn(2*c - 2*d) + arctan((c*tan(1/2*f*x + 1/2*e) - d*tan(1/2*f*x + 1/2*e))/sqrt(-
c^2 + d^2)))/(sqrt(-c^2 + d^2)*d^2))/f